package com.bj.zspace.excel;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Getter;
import lombok.Setter;

import java.util.HashSet;
import java.util.Set;

@Getter
@Setter
public class DataResult {
    @ExcelProperty("部分")
    private String department;
    @ExcelProperty("工作流数量")
    private int codes;
    @ExcelProperty("成功")
    private int success;
    @ExcelProperty("失败")
    private int fail;
    @ExcelProperty("成功率")
    private double successRate;
    @ExcelProperty("失败率")
    private double failRate;
    @ExcelIgnore
    private Set<String> codeSet = new HashSet<>();

    public void addSuccess() {
        this.success = this.success + 1;
    }

    public void addFail() {
        this.fail = this.fail + 1;
    }

    public void addCode(String code) {
        codeSet.add(code);
    }

}
